package work.chenbo.springboot.elasticsearch.service.impl;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import work.chenbo.springboot.elasticsearch.entity.NbaPlayer;
import work.chenbo.springboot.elasticsearch.manager.ElasticSearchManager;
import work.chenbo.springboot.elasticsearch.mapper.NbaPlayerBaseMapper;
import work.chenbo.springboot.elasticsearch.service.NbaPlayerService;

import java.util.List;

@Service
@Slf4j
@Data
public class NbaPlayerServiceImpl implements NbaPlayerService {

    private final NbaPlayerBaseMapper nbaPlayerBaseMapper;

    private final ElasticSearchManager elasticSearchManager;

    /**
     * 更具ID查询一个
     *
     * @param id
     * @author ChenBo
     * @date 2020/11/4
     */
    @Override
    public NbaPlayer selectOneById(Integer id) {
        return nbaPlayerBaseMapper.selectById(id);
    }

    /**
     * 查询全部
     *
     * @author ChenBo
     * @date 2020/11/4
     */
    @Override
    public List<NbaPlayer> selectAll() {
        return nbaPlayerBaseMapper.selectList(null);
    }
}
